<!DOCTYPE html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <script src="https://how2j.cn/study/js/jquery/2.0.0/jquery.min.js"></script>
    <link href="https://how2j.cn/study/css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
    <script src="https://how2j.cn/study/js/bootstrap/3.3.6/bootstrap.min.js"></script>
    <script src="https://how2j.cn/study/vue.min.js"></script>
    <script src="https://how2j.cn/study/axios.min.js"></script>
</head>
        <body>
        <div id="div1">
            <form action="/student/saveUserInfo" method="get" >
                <div style="width: 500px">
                    <div class="input-group">
                        <span class="input-group-addon" >账号</span>
                        <input type="text" class="form-control" name="username" :value="user.username" >
                    </div>
                    <div class="input-group">
                        <span class="input-group-addon" >密码</span>
                        <input type="text" class="form-control" name="password" :value="user.password" >
                    </div>
                    <div class="input-group">
                        <span class="input-group-addon" >昵称</span>
                        <input type="text" class="form-control" name="name" :value="user.name" >
                    </div>
                    <div class="input-group">
                        <span class="input-group-addon" >性别</span>
                        <input type="text" class="form-control" name="gender" :value="user.gender" >
                    </div>
                    <div class="input-group">
                        <span class="input-group-addon" >身份证</span>
                        <input type="text" class="form-control" name="idcard" :value="user.idcard" >
                    </div>
                    <button type="submit" class="btn btn-success">提交</button>
                </div>
            </form>
        </div>

        </body>


        <script>

            new Vue({
                el:'#div1',
                data:{
                    user:{}
                },
                mounted:function(){ //mounted　表示这个 Vue 对象加载成功了
                    var self = this
                    axios.get("/student/findUserInfo").then(function(response) {
                        self.user= response.data;
                    })
                },
                methods:{

                }
            })

        </script>
</html>
